﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.ProductionManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.ProductionManagement.ProdArchiveDataVMs
{
    public partial class ProdArchiveDataTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._ProdArchiveData._ArchiveId")]
        public ExcelPropety ArchiveId_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.ArchiveIdId);
        [Display(Name = "_Model._ProdArchiveData._DataTag")]
        public ExcelPropety DataTag_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.DataTag);
        [Display(Name = "_Model._ProdArchiveData._DataName")]
        public ExcelPropety DataName_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.DataName);
        [Display(Name = "_Model._ProdArchiveData._DataValue")]
        public ExcelPropety DataValue_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.DataValue);
        [Display(Name = "_Model._ProdArchiveData._UpLimit")]
        public ExcelPropety UpLimit_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.UpLimit);
        [Display(Name = "_Model._ProdArchiveData._LowerLimit")]
        public ExcelPropety LowerLimit_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.LowerLimit);
        [Display(Name = "_Model._ProdArchiveData._ProductCode")]
        public ExcelPropety ProductCode_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.ProductCode);
        [Display(Name = "_Model._ProdArchiveData._OpCode")]
        public ExcelPropety OpCode_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.OpCode);
        [Display(Name = "_Model._ProdArchiveData._SetParameter")]
        public ExcelPropety SetParameter_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.SetParameter);
        [Display(Name = "_Model._ProdArchiveData._ProductId")]
        public ExcelPropety ProductId_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.ProductId);
        [Display(Name = "_Model._ProdArchiveData._OpId")]
        public ExcelPropety OpId_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.OpId);
        [Display(Name = "_Model._ProdArchiveData._Wo")]
        public ExcelPropety Wo_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.Wo);
        [Display(Name = "_Model._ProdArchiveData._Sn")]
        public ExcelPropety Sn_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.Sn);
        [Display(Name = "_Model._ProdArchiveData._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.CreateTime, true);
        [Display(Name = "_Model._ProdArchiveData._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.UpdateTime, true);
        [Display(Name = "_Model._ProdArchiveData._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.CreateBy);
        [Display(Name = "_Model._ProdArchiveData._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.UpdateBy);
        [Display(Name = "_Model._ProdArchiveData._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.IsValid);
        [Display(Name = "_Model._ProdArchiveData._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<ProductionArchiveData>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            ArchiveId_Excel.DataType = ColumnDataType.ComboBox;
            ArchiveId_Excel.ListItems = DC.Set<ProductionArchive>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class ProdArchiveDataImportVM : BaseImportVM<ProdArchiveDataTemplateVM, ProductionArchiveData>
    {
            //import

    }

}